package bin_tree.oj;

public class Num101 {
    public boolean isSymmetric(TreeNode root) {
        return isSymmetric1(root,root);
    }
    public boolean isSymmetric1(TreeNode p,TreeNode q){
        if(p == null && q == null){
            return true;
        }
        if(p == null || q == null){
            return false;
        }
        return p.val == q.val && isSymmetric1(p.left,q.right) && isSymmetric1(p.right,q.left);
    }
}
